<template>
  <div class="hello">
    <h3>Hello World</h3>
    <ul>
      <li v-for="(item, index) in banner" :key="index">
        <p>{{ item.title }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
import api from "../api";

export default {
  name: "HelloWorld",
  data() {
    return {
      banner: [],
    };
  },
  created() {},
  mounted() {
    // axios.get("http://iwenwiki.com/api/blueberrypai/getIndexBanner.php").then(res =>{
    //   this.banner = res.data.banner
    // })

    // /**
    //  * user_id=iwen@qq.com&password=iwen123
    //  */
    // axios.post("http://iwenwiki.com/api/blueberrypai/login.php",qs.stringify({
    //   user_id:"iwen@qq.com",
    //   password:"iwen123",
    //   verification_code:"crfvw"
    // })).then(res =>{
    //   console.log(res.data);
    // })
    api.getBanner().then((res) => {
      this.banner = res.data.banner;
    });

    api.getLogin({
      user_id: "iwen@qq.com",
      password: "iwen123",
      verification_code: "crfvw",
    }).then(res =>{
      console.log(res.data);
    }).catch(error =>{
      console.log(error);
    })
  },
  updated() {},
  destoryed() {},
};
</script>
